import request from '@/utils/request';
import { objectToFormData} from '@/utils/form'


export function listForClassify(data: any) {
  return request({
    url: '/api/v1/scene/classify/list',
    method: 'post',
    data: data
  });
}


export function selectTree(data: any) {
  return request({
    url: '/api/v1/scene/classify/selectTree',
    method: 'post',
    data: data
  });
}

export function saveForTree(data: any) {
  return request({
    url: '/api/v1/scene/classify/save',
    method: 'post',
    data: data
  });
}

export function deleteForTree(data: any) {
  return request({
    url: '/api/v1/scene/classify/delete',
    method: 'post',
    data: data
  });
}


export function saveForScene(data: any) {
  return request({
    url: '/api/v1/scene/save',
    method: 'post',
	headers: { "Content-Type": "multipart/form-data" },
    data: objectToFormData(data)
  });
}

export function listForScene(data: any) {
  return request({
    url: '/api/v1/scene/list',
    method: 'post',
    data: data
  });
}

export function deleteForScene(data: any) {
  return request({
    url: '/api/v1/scene/delete',
    method: 'post',
    data: data
  });
}

export function listForUsers(data: any) {
  return request({
    url: '/api/v1/user/project/list',
    method: 'post',
    data: data
  });
}

export function saveForUsers(data: any) {
  return request({
    url: '/api/v1/user/project/save',
    method: 'post',
    data: data
  });
}


export function saveForCustomAPI(data: any) {
  return request({
    url: '/api/v1/itester/custom/save',
    method: 'post',
    data: data
  });
}

export function listForCustomAPI(data: any) {
  return request({
    url: '/api/v1/itester/custom/list',
    method: 'post',
    data: data
  });
}

export function deleteForCustomAPI(data: any) {
  return request({
    url: '/api/v1/itester/custom/delete',
    method: 'post',
    data: data
  });
}